package baidu;

import java.util.*;

/**
 * 广度优先
 */
public class Main1 {
    private static int n;
    private static long k0,maxH;
    private static long[] h,a,copy;
    private static long ans;
    private static Queue<Long[]> queue=new LinkedList<>();
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        n=scanner.nextInt();
        k0=scanner.nextLong();
        h=new long[n];
        a=new long[n];
        copy=new long[n];
        for(int i=0;i<n;++i){
            h[i]=scanner.nextLong();
            copy[i]=h[i];
        }
        for(int i=0;i<n;++i){
            a[i]=scanner.nextLong();
        }
        //如果初始值小于第一座山
        if(k0<h[0]){
            ans=-1;
        }
        //最高的山
        Arrays.sort(copy);
        maxH=copy[n-1];
        queue.add(new Long[]{1L,k0+a[0],1L});
        queue.add(new Long[]{0L,k0,1L});
        bfs();

        System.out.println(ans);
    }

    private static void bfs() {
        while(!queue.isEmpty()){
            Long tmp[]=queue.poll();
            if(tmp[1]>=maxH){
                ans=tmp[0]-1;
                return;
            }
            if(tmp[1]>=h[Math.toIntExact(tmp[2])]){//当前的体力值不小于下一座山的值
                queue.add(new Long[]{tmp[0]+1,tmp[1]+a[(int) (tmp[2]-1)],tmp[2]+1});
                queue.add(new Long[]{tmp[0],tmp[1],tmp[2]+1});
            }
        }
    }
}
class Node{
    int step;
    int weight;
    int index;

}